package server.core.tcp;

import server.core.AbstractSend2Data;
import server.core.AbstractSenderFactory;
import server.core.IGetDeviceInfo;
import server.core.tcp.CommonTcpSender;

/**
 * describe:
 *
 * @author helloworldyu
 * @data 2018/1/25
 */
public class TcpSenderFactory extends AbstractSenderFactory {

	private final static String COMMON = "common";

	@Override
	public IGetDeviceInfo createDeviceInfoer(String condition) {
		System.out.println("我得从 redis 里查找设备信息");
		return new RedisOperation();
	}

	@Override
	public AbstractSend2Data createSender(String condition) {
		System.out.println("我费很大的劲搞出一个 commontcp 的下发实现类");
		if( COMMON.equals(condition) ){
			return new CommonTcpSender("tcp sender");
		}else {
			return null;
		}
	}
}